package poker;

import java.awt.Color;

import javax.swing.*;
import java.util.Random;

public class BotGui extends PlayerGui {
	private static final long serialVersionUID = 1L;
	
	  private Random generator=new Random();

	  
	  
	public BotGui(int i)	{
		setBackground(new Color(0, 139, 139));
		setFocusable(false);
		setLayout(null);
		switch(i){
	      case 0:
		    setBounds(192-160, 325, 240, 120);
		    break;
	      case 1:
	    	setBounds(192-160, 32, 240, 120);
		    break;
	      case 2:
		    setBounds(192+160, 32, 240, 120);
		    break;
	      case 3:
	    	setBounds(192+160, 325, 240, 120);
		    break;
	    
		}
	}

	  /** ZWRACANIE TABLICY KART DO WYMIANY (LOSOWYCH). */
	  int[] exchangeCards(TableGui table){
	    int[] toExchange;
	    int random1,random2,alreadyUsed;
	    random1=generator.nextInt(5);
		if(random1==0){toExchange=new int[] {0};}
		else{
		  toExchange=new int[random1];
		  for(int i=0;i<random1;i++){
			do{
			  alreadyUsed=0;
		      random2=(generator.nextInt(5)+1);
			  for(int j=0;j<i;j++){if(toExchange[j]==random2) alreadyUsed=1;}
			}
			while(alreadyUsed==1);
			toExchange[i]=random2;
		  }
		}
		return toExchange;
	  }
/*
	  int betAction(boolean noBet, boolean allIn, boolean canCall, boolean canRaise){
		    int random;
		    /** MOZNA ZAGRAC: Check, Bet, Fold, All-In. 
			/** SZANSA: 30%-Check, 60%-Bet, 5%-Fold, 5%-All-In. 
			if(noBet){
			random=generator.nextInt(100)+1;
			if(random<=30){return 1;}
			else if((random>30)&&(random<=90)){return 2;}
			else if((random>90)&&(random<=95)){return 5;}
			else if(random>95){return 6;}
			}
			/** MOZNA ZAGRAC: Raise, Call, Fold, All-In. */
			/** SZANSA: 25%-Raise, 50%-Call, 15%-Fold, 10%-All-In. 
			else if((!noBet)&&(!allIn)&&(canCall)&&(canRaise)){
			random=generator.nextInt(100)+1;
			if(random<=25){return 3;}
			else if((random>25)&&(random<=75)){return 4;}
			else if((random>75)&&(random<=90)){return 5;}
			else if(random>90){return 6;}
			}
			/** MOZNA ZAGRAC: Call, Fold, All-In. 
			/** SZANSA: 30%-Call, 40%-Fold, 30%-All-In. 
			else if((!noBet)&&(!allIn)&&(canCall)&&(!canRaise)){
			random=generator.nextInt(100)+1;
			if(random<=30){return 4;}
			else if((random>30)&&(random<=70)){return 5;}
			else if(random>70){return 6;}
			}
			/** MOZNA ZAGRAC: Fold, All-In. 
			/** SZANSA: 50%-Fold, 50%-All-In. 
			else if((!noBet)&&(!allIn)&&(!canCall)){
			random=generator.nextInt(100)+1;
			if(random<=50){return 5;}
			else if(random>50){return 6;}
			}
			/** MOZNA ZAGRAC: Fold, All-In. 
			/** SZANSA 50%-Fold, 50%-All-In. 
			else if(allIn){
			random=generator.nextInt(100)+1;
			if(random<=50){return 5;}
			else if(random>50){return 6;}
			}
		  return 0;
	 }
	  */

	@Override
	int[] exchangeCards(int j, TableGui table) {
		// TODO Auto-generated method stub
		return null;
	}
	 

}